package main

import (
	"log"
	"net/http"
)

func main() {
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		// 使用大号字体展示版本信息
		html := `<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>streamd</title>
    <style>
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            background-color: #f0f0f0;
            font-family: Arial, sans-serif;
        }
        .version {
            font-size: 48px;
            color: #333;
            font-weight: bold;
        }
    </style>
</head>
<body>
    <div class="version">streamd v1.0.0 running...</div>
</body>
</html>`
		w.Header().Set("Content-Type", "text/html; charset=utf-8")
		w.Write([]byte(html))
	})
	log.Println("streamd 启动，监听 38013 端口")

	if err := http.ListenAndServe(":38013", nil); err != nil {
		log.Fatal(err)
	}
}
